function s_out=gen_ortho(s_in,nt,nr)
%assume length is 4

s_out=zeros(nt,2*nt);
s_out(1,1)=s_in(1,1);
s_out(2,1)=s_in(2,1);
s_out(3,1)=s_in(3,1);
s_out(4,1)=s_in(4,1);
s_out(1,2)=-s_in(2,1);
s_out(2,2)=s_in(1,1);
s_out(3,2)=-s_in(4,1);
s_out(4,2)=s_in(3,1);
s_out(1,3)=-s_in(3,1);
s_out(2,3)=s_in(4,1);
s_out(3,3)=s_in(1,1);
s_out(4,3)=-s_in(2,1);
s_out(1,4)=-s_in(4,1);
s_out(2,4)=-s_in(3,1);
s_out(3,4)=s_in(2,1);
s_out(4,4)=s_in(1,1);
s_out(1,5)=conj(s_in(1,1));
s_out(2,5)=conj(s_in(2,1));
s_out(3,5)=conj(s_in(3,1));
s_out(4,5)=conj(s_in(4,1));
s_out(1,6)=-conj(s_in(2,1));
s_out(2,6)=conj(s_in(1,1));
s_out(3,6)=-conj(s_in(4,1));
s_out(4,6)=conj(s_in(3,1));
s_out(1,7)=-conj(s_in(3,1));
s_out(2,7)=conj(s_in(4,1));
s_out(3,7)=conj(s_in(1,1));
s_out(4,7)=-conj(s_in(2,1));
s_out(1,8)=-conj(s_in(4,1));
s_out(2,8)=-conj(s_in(3,1));
s_out(3,8)=conj(s_in(2,1));
s_out(4,8)=conj(s_in(1,1));



